]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Make GridSearchResults take a grid as an optional parameter
authorMorten Mjelva <morten.mjelva@gmail.com>
Sun, 28 Aug 2011 20:14:15 +0000 (22:14 +0200)
committerOwen W. Taylor <otaylor@fishsoup.net>
Mon, 29 Aug 2011 21:29:11 +0000 (17:29 -0400)
This is useful since contact search results use a custom grid

https://bugzilla.gnome.org/show_bug.cgi?id=643018

js/ui/searchDisplay.js

index d1534afb1dda972c8d17d28fc791b7bfa14b3d49..580f410be3ae6bcf16a33ba558a6e223b4d43a00 100644 (file)
@@ -100,17 +100,17 @@ SearchResult.prototype = {
 };
 
 
-function GridSearchResults(provider) {
-    this._init(provider);
+function GridSearchResults(provider, grid) {
+    this._init(provider, grid);
 }
 
 GridSearchResults.prototype = {
     __proto__: Search.SearchResultDisplay.prototype,
 
-    _init: function(provider) {
+    _init: function(provider, grid) {
         Search.SearchResultDisplay.prototype._init.call(this, provider);
-        this._grid = new IconGrid.IconGrid({ rowLimit: MAX_SEARCH_RESULTS_ROWS,
-                                             xAlign: St.Align.START });
+        this._grid = grid || new IconGrid.IconGrid({ rowLimit: MAX_SEARCH_RESULTS_ROWS,
+                                                     xAlign: St.Align.START });
         this.actor = new St.Bin({ x_align: St.Align.START });
 
         this.actor.set_child(this._grid.actor);